Don't assume grep supports GREP_OPTIONS
authorRob Browning <rlb@defaultvalue.org>
Sat, 19 Sep 2015 19:46:40 +0000 (14:46 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 19 Sep 2015 19:46:45 +0000 (14:46 -0500)
Add 0008-Emacs-won-t-assume-grep-supports-GREP_OPTIONS.patch to
incorporate the relevant upstream patch.  Thanks to Bob Proulx
<bob@proulx.com> for reporting the problem, and Ben Finney
<ben+debian@benfinney.id.au> for tracking down the fix.

Closes: 793741
1  2 
debian/.git-dpm
debian/patches/0008-Emacs-won-t-assume-grep-supports-GREP_OPTIONS.patch
debian/patches/series

diff --cc debian/.git-dpm
index 5104310a135a1e064d20a962882b7ae28bc49b4b,0000000000000000000000000000000000000000..b5567b9c9809b93d53babf13fc9e488075efca21
mode 100644,000000..100644
--- /dev/null
@@@ -1,8 -1,0 +1,8 @@@
- 77abacb3b4d4bcb51bedf5d98881c069be402408
- 77abacb3b4d4bcb51bedf5d98881c069be402408
 +# see git-dpm(1) from git-dpm package
++59467953c905b8d1c015dec9ba41df38af3df30e
++59467953c905b8d1c015dec9ba41df38af3df30e
 +62bc68f777c532a970566625e315d68bf0ab4eee
 +62bc68f777c532a970566625e315d68bf0ab4eee
 +emacs24_24.5+1.orig.tar.bz2
 +790a17cf600831dd5c36afddb9cb48bc5482e6c9
 +24401779
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..3db2fcac6fd9167665bed89d410999b3bb458b28
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,100 @@@
++From 59467953c905b8d1c015dec9ba41df38af3df30e Mon Sep 17 00:00:00 2001
++From: Paul Eggert <eggert@cs.ucla.edu>
++Date: Tue, 16 Sep 2014 17:07:12 -0700
++Subject: Emacs won't assume grep supports GREP_OPTIONS
++
++This upstream patch has been added:
++
++  Don't assume 'grep' supports GREP_OPTIONS.
++
++  The GREP_OPTIONS environment variable is planned to be marked
++  obsolescent in GNU grep, due to problems in its use, so stop
++  relying on it.
++  * progmodes/grep.el (grep-highlight-matches): Document this.
++  (grep-process-setup): Do not set GREP_OPTIONS.
++  (grep-compute-defaults): Use an explicit --color option if supported.
++
++Origin: upstream, commit: 2e4c2fe2787785a421f256541de642976e9bd90b
++Bug: http://debbugs.gnu.org/19247
++Bug-Debian: http://bugs.debian.org/793741
++Added-by: Rob Browning <rlb@defaultvalue.org>
++---
++ lisp/ChangeLog         | 10 ++++++++++
++ lisp/progmodes/grep.el | 21 +++++++++++----------
++ 2 files changed, 21 insertions(+), 10 deletions(-)
++
++diff --git a/lisp/ChangeLog b/lisp/ChangeLog
++index eb31d5f..7345c6a 100644
++--- a/lisp/ChangeLog
+++++ b/lisp/ChangeLog
++@@ -1165,6 +1165,16 @@
++      count the whole visible buffer.  Correctly convert the body-height
++      to pixel size for window-text-pixel-size (Bug#18498).
++ 
+++2014-09-17  Paul Eggert  <eggert@cs.ucla.edu>
+++
+++     Don't assume 'grep' supports GREP_OPTIONS.
+++     The GREP_OPTIONS environment variable is planned to be marked
+++     obsolescent in GNU grep, due to problems in its use, so stop
+++     relying on it.
+++     * progmodes/grep.el (grep-highlight-matches): Document this.
+++     (grep-process-setup): Do not set GREP_OPTIONS.
+++     (grep-compute-defaults): Use an explicit --color option if supported.
+++
++ 2014-09-14  Glenn Morris  <rgm@gnu.org>
++ 
++      * image.el (image-multi-frame-p): Fix thinko - do not force
++diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
++index d4caf48..0e8c214 100644
++--- a/lisp/progmodes/grep.el
+++++ b/lisp/progmodes/grep.el
++@@ -77,11 +77,10 @@ in grep buffers, so if you have globally disabled font-lock-mode,
++ you will not get highlighting.
++ 
++ This option sets the environment variable GREP_COLORS to specify
++-markers for highlighting and GREP_OPTIONS to add the --color
++-option in front of any explicit grep options before starting
++-the grep.
+++markers for highlighting and adds the --color option in front of
+++any explicit grep options before starting the grep.
++ 
++-When this option is `auto', grep uses `--color=auto' to highlight
+++When this option is `auto', grep uses `--color' to highlight
++ matches only when it outputs to a terminal (when `grep' is the last
++ command in the pipe), thus avoiding the use of any potentially-harmful
++ escape sequences when standard output goes to a file or pipe.
++@@ -97,7 +96,7 @@ To change the default value, use Customize or call the function
++   :type '(choice (const :tag "Do not highlight matches with grep markers" nil)
++               (const :tag "Highlight matches with grep markers" t)
++               (const :tag "Use --color=always" always)
++-              (const :tag "Use --color=auto" auto)
+++              (const :tag "Use --color" auto)
++               (other :tag "Not Set" auto-detect))
++   :set 'grep-apply-setting
++   :version "22.1"
++@@ -467,10 +466,6 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
++     ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
++     ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'
++     (setenv "TERM" "emacs-grep")
++-    (setenv "GREP_OPTIONS"
++-         (concat (getenv "GREP_OPTIONS")
++-                 " --color=" (if (eq grep-highlight-matches 'always)
++-                                 "always" "auto")))
++     ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions
++     (setenv "GREP_COLOR" "01;31")
++     ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
++@@ -570,7 +565,13 @@ This function is called from `compilation-filter-hook'."
++     (unless (and grep-command grep-find-command
++               grep-template grep-find-template)
++       (let ((grep-options
++-          (concat (if grep-use-null-device "-n" "-nH")
+++          (concat (and grep-highlight-matches
+++                       (grep-probe grep-program
+++                                   `(nil nil nil "--color" "x" ,null-device)
+++                                   nil 1)
+++                       (if (eq grep-highlight-matches 'always)
+++                           "--color=always " "--color "))
+++                  (if grep-use-null-device "-n" "-nH")
++                   (if (grep-probe grep-program
++                                   `(nil nil nil "-e" "foo" ,null-device)
++                                   nil 1)
index 2708556d91738324a9a9106435ce1b67ba758007,0000000000000000000000000000000000000000..68c50717b75fedf116d1b4a29b6e64f0a94bb589
mode 100644,000000..100644
--- /dev/null
@@@ -1,7 -1,0 +1,8 @@@
 +0001-Prefer-usr-share-info-emacs-24-over-usr-share-info.patch
 +0002-Run-debian-startup-and-set-debian-emacs-flavor.patch
 +0003-Remove-files-that-appear-to-be-incompatible-with-the.patch
 +0004-Adjust-documentation-references-for-Debian.patch
 +0005-Modify-the-output-of-version-to-indicate-Debian-modi.patch
 +0006-Look-for-NEWS-in-order-to-find-etc-rather-than-GNU.patch
 +0007-Don-t-try-to-build-src-macuvs.h-via-IVD_Sequences.tx.patch
++0008-Emacs-won-t-assume-grep-supports-GREP_OPTIONS.patch